package com.jctrip.hotel.source.model.CnBooking.req;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author henry
 * @Date 2023/7/2 09:22
 * @Description
 */
@Data
@JacksonXmlRootElement(localName = "CNRequest")
public class BaseRequest {
    @JacksonXmlProperty(localName = "ActionName")
    private String actionName;

    @JacksonXmlProperty(localName = "IdentityInfo")
    @JacksonXmlElementWrapper
    private IdentityInfo identityInfo;

    @JacksonXmlProperty(localName = "ScrollingInfo")
    @JacksonXmlElementWrapper
    private ScrollingInfo scrollingInfo;


    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class IdentityInfo {
        @JacksonXmlProperty(localName = "AppId")
        private String appId;
        @JacksonXmlProperty(localName = "SecurityKey")
        private String securityKey;
        @JacksonXmlProperty(localName = "UserName")
        private String userName;
        @JacksonXmlProperty(localName = "PassWord")
        private String passWord;
        @JacksonXmlProperty(localName = "Signature")
        private String signature;

    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class ScrollingInfo {
        @JacksonXmlProperty(localName = "DisplayReq")
        private Integer displayReq;
        @JacksonXmlProperty(localName = "PageItems")
        private Integer pageItems;
        @JacksonXmlProperty(localName = "PageNo")
        private Integer pageNo;
    }
}
